import MapboxDraw2 from "./bundle.js";

mapboxgl.accessToken =
  "pk.eyJ1IjoiYWlvb2lvbyIsImEiOiJjbHdhNHhxbTIwNjBiMmlxdGVpeDdnZzM4In0.vHK5bpeCj4sSK2POMI4y4Q";

const map = new mapboxgl.Map({
  container: "map",
  style: "mapbox://styles/mapbox/streets-v9",
  projection: "globe", // Display the map as a globe, since satellite-v9 defaults to Mercator
  zoom: 2,
  center: [115, 30],
});

map.on("style.load", () => {
  map.setFog({}); // Set the default atmosphere style

  const draw2 = new MapboxDraw2({
    map: map,
  });

  draw2.changeMode("draw_attack_arrow");
});

// const draw = new MapboxDraw({
//   displayControlsDefault: true,
//   // Select which mapbox-gl-draw control buttons to add to the map.
//   controls: {
//     polygon: true,
//     trash: true,
//   },
//   // Set mapbox-gl-draw to draw by default.
//   // The user does not have to click the polygon control button first.
//   defaultMode: "draw_polygon",
// });
// map.addControl(draw);
